/* eslint-disable array-callback-return */
/* eslint-disable consistent-return */

import React, { Component, Fragment } from 'react';
import { Form } from '@ant-design/compatible';
import '@ant-design/compatible/assets/index.css';
import {
  Card,
  Row,
  Col,
  Select,
  Table,
  Checkbox,
  InputNumber,
  Cascader,
  Divider,
  message,
} from 'antd';
import { matchDict } from '@/utils/utils';

const FormItem = Form.Item;
const { Option } = Select;

class InsAccuInfo extends Component {
  // 选择社保缴费方式：1是单立户 2是大库
  selectInsPayWay = value => {
    const {
      dispatch,
      addinfo: {
        custId,
        insKinds,
        requestAddBaseDto,
        pdSetFlag,
        requestInsAndAccuDto,
        isHasInjury,
      },
      form,
    } = this.props;
    let isInsSupplyRun = false;
    let areaId = null;
    if (pdSetFlag === '2') {
      areaId = requestAddBaseDto.cityId && requestAddBaseDto.cityId.key;
      isInsSupplyRun = requestAddBaseDto.execType === '2' && value === '2';
      dispatch({
        type: 'addinfo/updateModelData',
        payload: {
          isInsSupplyRun: requestAddBaseDto.execType === '2' && value === '2',
        },
      });
      // 产品分项打开
    } else {
      requestAddBaseDto.requestPdInfo.map(item => {
        if (item.pdId === 'PDINF_0000000001') {
          isInsSupplyRun = item.execType === '2' && value === '2';
          if (item.cityId) {
            areaId = item.cityId.key;
          }
          dispatch({
            type: 'addinfo/updateModelData',
            payload: {
              isInsSupplyRun: item.execType === '2' && value === '2',
            },
          });
        }
      });
    }
    dispatch({
      type: 'addinfo/updateModelData',
      payload: {
        insPayStyle: value,
        isInsPayStyleSingle: value === '1',
        isSecAccu: (value === '2' && areaId === '1415662' && isHasInjury && true) || false,
        requestInsAndAccuDto: {
          ...requestInsAndAccuDto,
          insAcco: undefined,
          insGrpId: undefined,
          injSecAccoId: undefined,
        },
        isInsIde: false,
        insAcountList: [],
        insGroupList: [],
        insIdeList: [],
      },
    });
    if (!areaId) {
      return message.warning('请先选择执行地，即可获取社保账户列表！');
    }
    // 获取社保账户列表
    if (custId && areaId && insKinds && !isInsSupplyRun) {
      dispatch({
        type: 'addinfo/fetchInsAcountList',
        payload: {
          custId,
          areaId,
          insKinds,
          payWay: value,
        },
      });
    }
    if (value === '2') {
      // 大库
      // 获取社保组合列表
      if (areaId && insKinds) {
        dispatch({
          type: 'addinfo/fetchInsGroupList',
          payload: {
            custId,
            areaId,
            pdId: 'PDINF_0000000001',
            insKinds,
          },
        });
      }
      if (areaId === '1415662' && isHasInjury && !isInsSupplyRun) {
        // 石家庄维护工伤而二级户
        // 获取工伤二级户
        dispatch({
          type: 'addinfo/fetchSecAccoList',
          payload: {
            custId,
            areaId,
            payWay: value,
            insKinds: ['5'],
          },
        }).then(secAccuIntValue => {
          form.setFieldsValue({
            'requestInsAndAccuDto.injSecAccoId': secAccuIntValue || undefined,
          });
        });
      }
    }
  };

  // 选择社保账户
  selectInsAccount = (value, options) => {
    const {
      dispatch,
      addinfo: {
        custId,
        insKinds,
        requestInsAndAccuDto,
        insPayStyle,
        pdSetFlag,
        requestAddBaseDto,
      },
    } = this.props;
    dispatch({
      type: 'addinfo/updateModelData',
      payload: {
        requestInsAndAccuDto: {
          ...requestInsAndAccuDto,
          insGrpId: undefined,
        },
      },
    });
    if (!value) {
      // 清除当前选择
      dispatch({
        type: 'addinfo/updateModelData',
        payload: {
          insGroupList: [],
          insIdeList: [],
          isInsIde: false,
          requestInsAndAccuDto: {
            ...requestInsAndAccuDto,
            insIde: undefined,
            insGrpId: undefined,
          },
        },
      });
      let areaId = null;
      if (pdSetFlag === '2') {
        areaId = requestAddBaseDto.cityId && requestAddBaseDto.cityId.key;
        // 产品分项打开
      } else {
        requestAddBaseDto.requestPdInfo.map(item => {
          if (item.pdId === 'PDINF_0000000001' && item.cityId) {
            areaId = item.cityId.key;
          }
        });
      }
      if (insPayStyle === '2' && areaId && insKinds) {
        //  大库
        dispatch({
          type: 'addinfo/fetchInsGroupList',
          payload: {
            custId,
            areaId,
            pdId: 'PDINF_0000000001',
            insKinds,
          },
        });
      }
    }
    const plcyInfo = options && options.props && options.props.fsOptions;
    if (plcyInfo && plcyInfo.plcyId) {
      // 单立户：社保账户带出社保组合：
      dispatch({
        type: 'addinfo/updateModelData',
        payload: {
          isInsIde: plcyInfo.insIdeFlag === 1, // 缴费人员类别
          insGroupList: [
            {
              lsPkgId: plcyInfo.plcyId,
              lsPkgName: plcyInfo.plcyName,
              insIdeFlag: plcyInfo.insIdeFlag,
            },
          ],
          requestInsAndAccuDto: {
            ...requestInsAndAccuDto,
            insGrpId: plcyInfo.plcyId,
            insIde: undefined,
          },
        },
      });
      if (plcyInfo.insIdeFlag === 1) {
        // 获取缴费人员列表
        let areaId = null;
        if (pdSetFlag === '2') {
          areaId = requestAddBaseDto.cityId && requestAddBaseDto.cityId.key;
          // 产品分项打开
        } else {
          requestAddBaseDto.requestPdInfo.map(item => {
            if (item.pdId === 'PDINF_0000000001' && item.cityId) {
              areaId = item.cityId.key;
            }
          });
        }
        if (areaId) {
          dispatch({
            type: 'addinfo/fetchInsIdeList',
            payload: { areaId },
          });
        }
      }
    }
    if (plcyInfo && plcyInfo.suppPkgs) {
      // 大库：社保账户带出社保组合
      plcyInfo.suppPkgs.map(item => {
        const temp = item;
        temp.lsPkgId = item.plcyId;
        temp.lsPkgName = item.plcyName;
        temp.insIdeFlag = item.insIdeFlag;
      });
      dispatch({
        type: 'addinfo/updateModelData',
        payload: {
          insGroupList: plcyInfo.suppPkgs,
          requestInsAndAccuDto: {
            ...requestInsAndAccuDto,
            insGrpId: undefined,
            insIde: undefined,
          },
        },
      });
    }
  };

  // 选择社保组合
  selectInsdGroup = (value, options) => {
    const {
      dispatch,
      addinfo: { pdSetFlag, requestAddBaseDto, requestInsAndAccuDto },
    } = this.props;
    const plcyInfo = options.props.fsOptions;
    dispatch({
      type: 'addinfo/updateModelData',
      payload: {
        isInsIde: plcyInfo.insIdeFlag === 1, // 缴费人员类别
        requestInsAndAccuDto: {
          ...requestInsAndAccuDto,
          insIde: undefined,
        },
      },
    });
    if (plcyInfo.insIdeFlag === 1) {
      // 获取缴费人员列表
      let areaId = null;
      if (pdSetFlag === '2') {
        areaId = requestAddBaseDto.cityId && requestAddBaseDto.cityId.key;
        // 产品分项打开
      } else {
        requestAddBaseDto.requestPdInfo.map(item => {
          if (item.pdId === 'PDINF_0000000001' && item.cityId) {
            areaId = item.cityId.key;
          }
        });
      }
      if (areaId) {
        dispatch({
          type: 'addinfo/fetchInsIdeList',
          payload: { areaId },
        });
      }
    }
  };

  // 选择工伤二级户
  selectSecAcco = (value, options) => {
    if (value.length === 1) {
      return message.warning(`请选择"${options[0].accoName}"的二级户`);
    }
  };

  // 选择公积金缴费方式
  selectAccuPayWay = value => {
    const {
      dispatch,
      addinfo: { custId, requestAddBaseDto, pdSetFlag, requestInsAndAccuDto },
    } = this.props;
    let isAccuSupplyRun = false;
    let areaId = null;
    if (pdSetFlag === '2') {
      isAccuSupplyRun = requestAddBaseDto.execType === '2' && value === '2';
      areaId = requestAddBaseDto.cityId && requestAddBaseDto.cityId.key;
      dispatch({
        type: 'addinfo/updateModelData',
        payload: {
          isAccuSupplyRun: requestAddBaseDto.execType === '2' && value === '2',
        },
      });
      // 产品分项打开
    } else {
      requestAddBaseDto.requestPdInfo.map(item => {
        if (item.pdId === 'PDINF_0000000002') {
          isAccuSupplyRun = item.execType === '2' && value === '2';
          if (item.cityId) {
            areaId = item.cityId.key;
          }
          dispatch({
            type: 'addinfo/updateModelData',
            payload: {
              isAccuSupplyRun: item.execType === '2' && value === '2',
            },
          });
        }
      });
    }
    if (!areaId) {
      return message.warning('请先选择执行地，即可获取公积金账户列表！');
    }
    // 获取公积金账户列表
    if (areaId && !isAccuSupplyRun) {
      dispatch({
        type: 'addinfo/fetchAccuAcountList',
        payload: {
          custId,
          areaId,
          insKinds: [],
          payWay: value,
        },
      });
    }

    dispatch({
      type: 'addinfo/updateModelData',
      payload: {
        accuPayStyle: value,
        isAccuPayStyleSingle: value === '1',
        requestInsAndAccuDto: {
          ...requestInsAndAccuDto,
          accuAcco: undefined,
          accuGrpId: undefined,
        },
        accuAcountList: [],
        accuGroupList: [],
      },
    });
    if (value === '2') {
      // 大库
      // 获取公积金组合列表
      if (areaId) {
        dispatch({
          type: 'addinfo/fetchAccuGroupList',
          payload: {
            custId,
            areaId,
            pdId: 'PDINF_0000000002',
            insKinds: ['2'],
          },
        });
      }
    }
  };

  // 选择公积金账户
  selectAccuAccount = (value, options) => {
    const {
      dispatch,
      addinfo: { custId, requestInsAndAccuDto, accuPayStyle, pdSetFlag, requestAddBaseDto },
    } = this.props;
    dispatch({
      type: 'addinfo/updateModelData',
      payload: {
        requestInsAndAccuDto: {
          ...requestInsAndAccuDto,
          accuGrpId: undefined,
        },
      },
    });
    if (!value) {
      // 清除当前选择
      dispatch({
        type: 'addinfo/updateModelData',
        payload: {
          accuGroupList: [],
        },
      });
      let areaId = null;
      if (pdSetFlag === '2') {
        areaId = requestAddBaseDto.cityId && requestAddBaseDto.cityId.key;
        // 产品分项打开
      } else {
        requestAddBaseDto.requestPdInfo.map(item => {
          if (item.pdId === 'PDINF_0000000002' && item.cityId) {
            areaId = item.cityId.key;
          }
        });
      }
      if (accuPayStyle === '2' && areaId) {
        //  大库
        dispatch({
          type: 'addinfo/fetchAccuGroupList',
          payload: {
            custId,
            areaId,
            pdId: 'PDINF_0000000002',
            insKinds: ['2'],
          },
        });
      }
    }
    const plcyInfo = options && options.props && options.props.fsOptions;
    if (plcyInfo && plcyInfo.plcyId) {
      // 社保账户带出公积金组合
      dispatch({
        type: 'addinfo/updateModelData',
        payload: {
          accuGroupList: [
            {
              lsPkgId: plcyInfo.plcyId,
              lsPkgName: plcyInfo.plcyName,
            },
          ],
          requestInsAndAccuDto: {
            ...requestInsAndAccuDto,
            accuGrpId: plcyInfo.plcyId,
          },
        },
      });
    }
    if (plcyInfo && plcyInfo.suppPkgs) {
      // 大库：社保账户带出社保组合
      plcyInfo.suppPkgs.map(item => {
        const tempValue = item;
        tempValue.lsPkgId = item.plcyId;
        tempValue.lsPkgName = item.plcyName;
        tempValue.insIdeFlag = item.insIdeFlag;
      });
      dispatch({
        type: 'addinfo/updateModelData',
        payload: {
          accuGroupList: plcyInfo.suppPkgs,
        },
      });
    }
  };

  // 是否使用服务配置
  handleSerConfig = e => {
    const {
      dispatch,
      addinfo: {
        custId,
        quoId,
        pdSetFlag,
        requestAddBaseDto,
        requestInsAndAccuDto,
        insUnifyFlag,
        insList,
        isHasIns,
        isHasAccu,
        isAssSetFlag,
        assSetInsList,
      },
      dictCode,
    } = this.props;
    dispatch({
      type: 'addinfo/updateModelData',
      payload: {
        isSerConfig: e.target.checked,
        requestInsAndAccuDto: {
          ...requestInsAndAccuDto,
          serSetId: undefined,
        },
      },
    });
    if (e.target.checked) {
      // 获取服务配置列表
      const kindList = [];
      if (pdSetFlag === '1') {
        // 产品分项打开
        requestAddBaseDto.requestPdInfo.map(item => {
          if (item.pdId === 'PDINF_0000000001' && item.cityId) {
            // 社保 五险
            if (insUnifyFlag === 1) {
              // 五险合一
              kindList.push({
                areaId: item.cityId.key,
                kind: 1,
              });
            } else {
              // 五险不合一
              // eslint-disable-next-line no-lonely-if
              if (isAssSetFlag === '1') {
                // 险种打开
                assSetInsList.map(ins => {
                  kindList.push({
                    areaId: item.cityId.key,
                    kind: ins.itemCode,
                  });
                });
              } else {
                insList.map(ins => {
                  kindList.push({
                    areaId: item.cityId.key,
                    kind: ins.itemCode,
                  });
                });
              }
            }
          }
          if (item.pdId === 'PDINF_0000000002' && item.cityId) {
            // 公积金
            kindList.push({
              areaId: item.cityId.key,
              kind: 2,
            });
          }
        });
      } else {
        requestAddBaseDto.requestPdInfo.map(item => {
          if (item.pdId === 'PDINF_0000000001' && item.cityId) {
            // 社保 五险
            if (insUnifyFlag === 1) {
              // 五险合一
              kindList.push({
                areaId: requestAddBaseDto.cityId.key,
                kind: 1,
              });
            } else {
              // 五险不合一
              insList.map(ins => {
                kindList.push({
                  areaId: requestAddBaseDto.cityId.key,
                  kind: ins.itemCode,
                });
              });
            }
          }
          if (item.pdId === 'PDINF_0000000002' && item.cityId) {
            // 公积金
            kindList.push({
              areaId: requestAddBaseDto.cityId.key,
              kind: 2,
            });
          }
        });
      }
      if (kindList.length) {
        dispatch({
          type: 'addinfo/fetchSerConfigList',
          payload: {
            custId,
            quoId,
            kindList,
          },
        });
      } else {
        message.warning('请先选择执行地！');
      }
      const sortNumber = (a, b) => b.ass - a.ass; // 大于到小)
      const obj = { payWayName: '', accoName: '', grpName: '' };
      let serConfigData = [];
      if (isHasAccu) {
        serConfigData = dictCode.BIZ_ACCU_TYPE.map(item => ({
          ...item,
          ass: item.itemCode,
          assName: item.itemName,
          ...obj,
        }));
      }
      if (isHasIns) {
        if (insUnifyFlag === 1) {
          // 五险合一
          serConfigData.push({
            ass: '1',
            assName: '社保',
            ...obj,
          });
        } else {
          // 五险不合一
          serConfigData = [...serConfigData, ...(isAssSetFlag === '1' ? assSetInsList : insList)];
          serConfigData.map(item => {
            const temps = item;
            temps.ass = item.itemCode;
            temps.assName = item.itemName;
            Object.assign(item, obj);
          });
          serConfigData = serConfigData.sort(sortNumber);
        }
      }
      dispatch({
        type: 'addinfo/updateModelData',
        payload: { serConfigData },
      });
    }
  };

  // 选择服务配置
  selectSerConfig = (value, options) => {
    const {
      dispatch,
      addinfo: { serConfigData },
      dictCode,
    } = this.props;
    const serConfigInfo = options.props.serconinfo;
    const newSerConfigData = serConfigData.map(item => ({ ...item }));
    newSerConfigData.map(item => {
      const obj = item;
      obj.payWayName = '';
      obj.accoName = '';
      obj.grpName = '';
      serConfigInfo.map(s => {
        if (item.ass === `${s.kind}`) {
          obj.payWayName = matchDict(dictCode.PAY_FEES_WAY, s.payWay);
          obj.accoName = s.accoName;
          obj.grpName = s.plcyName;
        }
      });
    });
    dispatch({
      type: 'addinfo/updateModelData',
      payload: {
        serConfigData: newSerConfigData,
      },
    });
  };

  render() {
    const {
      form: { getFieldDecorator },
      addinfo: {
        insUnifyFlag, // 五险合一
        isHasIns, // 有无社保
        isHasAccu, // 有无公积金
        isSerConfig, // 是否使用服务配置
        isInsWageSet, // 是否社保工资分项
        isInsIde, // 是否有缴费人员类别
        insAcountList,
        insGroupList,
        accuAcountList,
        accuGroupList,
        serConfigList,
        isSecAccu, // 有无工伤二级户
        secAccuList,
        serConfigData,
        insIdeList, // 缴费人员类别
        insPayStyleList, // 社保缴费方式
        accuPayStyleList, // 公积金缴费方式
        isInsPayStyleSingle, // 社保缴费方式是不是单立户
        isAccuPayStyleSingle, // 公积金缴费方式是不是单立户
        assSetInsList,
        isInsSupplyRun,
        isAccuSupplyRun,
      },
      updateModelData,
    } = this.props;
    // 页面布局
    const xl = { span: 8 };
    const lg = { span: 8 };
    const md = { span: 8 };
    const sm = 24;
    const colProps = { xl, lg, md, sm };
     /* 限制数字输入框只能输入整数 */
    // const limitNumber = value => {
    //   if (typeof value === 'string') {
    //     return !isNaN(Number(value)) ? value.replace(/^(0+)|[^\d]/g, '') : ''
    //   } if (typeof value === 'number') {
    //     return !isNaN(value) ? String(value).replace(/^(0+)|[^\d]/g, '') : ''
    //   } 
    //     return ''
      
    // }
    // 服务配置columns
    const serConfigColumns = [
      {
        title: '险种',
        dataIndex: 'assName',
        width: 150,
        align: 'center',
      },
      {
        title: '缴费方式',
        dataIndex: 'payWayName',
        width: 150,
        align: 'center',
      },
      {
        title: '缴费账户',
        dataIndex: 'accoName',
        width: 200,
        align: 'center',
        render: text => (
          <a
            onClick={() => {
              message.warning('很抱歉，暂未配置详情页面，正在努力开发中。。。');
            }}
          >
            {text}
          </a>
        ),
      },
      {
        title: '政策组合',
        dataIndex: 'grpName',
        width: 200,
        align: 'center',
        render: text => (
          <a
            onClick={() => {
              message.warning('很抱歉，暂未配置详情页面，正在努力开发中。。。');
            }}
          >
            {text}
          </a>
        ),
      },
    ];

    return (
      <div>
        {isHasIns || isHasAccu ? (
          <Card
            title={
              <span style={{ fontWeight: 'bolder' }}>
                <span style={{ marginRight: 40 }}>社保公积金信息</span>
                <Checkbox value="1" onChange={this.handleSerConfig} style={{ marginRight: 20 }}>
                  使用服务配置
                </Checkbox>
                {isHasIns && insUnifyFlag === 2 && assSetInsList.length ? (
                  <Checkbox
                    value="2"
                    onChange={e => {
                      updateModelData({ isInsWageSet: e.target.checked });
                    }}
                  >
                    社保工资分项设置
                  </Checkbox>
                ) : null}
              </span>
            }
            bordered={false}
          >
            <Row gutter={64}>
              {(insUnifyFlag === 1 || !isInsWageSet) && isHasIns && (
                <Col {...colProps}>
                  <FormItem label="社保申报工资">
                    {getFieldDecorator('requestInsAndAccuDto.insDecWage', {
                      rules: [
                        {
                          required: true,
                          // message: '请输入小数点不超过2位的数字',
                          // pattern: /^-?\d+\.?\d{0,2}$/,
                          message: '请输入整数',
                          pattern: /^[1-9]\d*$/,
                        },
                      ],
                    })(
                      // <InputNumber
                      //   min={0}
                      //   max={9999999.99}
                      //   placeholder="请输入"
                      //   style={{ width: '100%' }}
                      // />
                      <InputNumber
                        min={0}
                        // parser={limitNumber}
                        max={9999999}
                        placeholder="请输入"
                        style={{ width: '100%' }}
                      />
                    )}
                  </FormItem>
                </Col>
              )}
              {insUnifyFlag === 2 &&
                isInsWageSet &&
                isHasIns &&
                assSetInsList.map(item => (
                  <Col {...colProps} key={item.itemCode}>
                    <FormItem label={`${item.itemName}申报工资`}>
                      {getFieldDecorator(`requestInsAndAccuDto.wage_${item.itemCode}`, {
                        rules: [
                          {
                            required: true,
                            // message: '请输入小数点不超过2位的数字',
                            // pattern: /^-?\d+\.?\d{0,2}$/,
                            message: '请输入整数',
                            pattern: /^[1-9]\d*$/,
                          },
                        ],
                      })(
                        // <InputNumber
                        //   min={0}
                        //   max={9999999.99}
                        //   placeholder="请输入"
                        //   style={{ width: '100%' }}
                        // />
                        <InputNumber
                          min={0}
                          max={9999999}
                          placeholder="请输入"
                          style={{ width: '100%' }}
                        />
                      )}
                    </FormItem>
                  </Col>
                ))}
              {!isSerConfig && isHasIns && (
                <Fragment>
                  <Col {...colProps}>
                    <FormItem label="社保缴费方式">
                      {getFieldDecorator('requestInsAndAccuDto.insPayFlag', {
                        rules: [{ required: true, message: '请选择' }],
                      })(
                        <Select
                          placeholder="请选择"
                          showSearch
                          optionFilterProp="children"
                          onChange={this.selectInsPayWay}
                        >
                          {insPayStyleList.map(item => (
                            <Option key={item.itemCode}>{item.itemName}</Option>
                          ))}
                        </Select>
                      )}
                    </FormItem>
                  </Col>
                  {!isInsSupplyRun && (
                    <Col {...colProps}>
                      <FormItem label="社保账户">
                        {getFieldDecorator('requestInsAndAccuDto.insAcco', {
                          rules: [{ required: isInsPayStyleSingle, message: '请选择' }],
                        })(
                          <Select
                            placeholder="请选择"
                            allowClear={!isInsPayStyleSingle}
                            showSearch
                            optionFilterProp="children"
                            onChange={this.selectInsAccount}
                          >
                            {insAcountList.map(item => (
                              <Option key={item.accoId} value={item.accoId} fsOptions={item}>
                                {item.accoName}
                              </Option>
                            ))}
                          </Select>
                        )}
                      </FormItem>
                    </Col>
                  )}
                  <Col {...colProps}>
                    <FormItem label="社保组合">
                      {getFieldDecorator('requestInsAndAccuDto.insGrpId', {
                        rules: [{ required: true, message: '请选择' }],
                      })(
                        <Select
                          placeholder="请选择"
                          optionFilterProp="children"
                          disabled={isInsPayStyleSingle}
                          onChange={this.selectInsdGroup}
                        >
                          {insGroupList.map(item => (
                            <Option key={item.lsPkgId} value={item.lsPkgId} fsOptions={item}>
                              {item.lsPkgName}
                            </Option>
                          ))}
                        </Select>
                      )}
                    </FormItem>
                  </Col>
                  {isInsIde && (
                    <Col {...colProps}>
                      <FormItem label="缴费人员类别">
                        {getFieldDecorator('requestInsAndAccuDto.insIde', {
                          rules: [{ required: false, message: '请选择' }],
                        })(
                          <Select
                            placeholder="请选择"
                            showSearch
                            optionFilterProp="children"
                            allowClear
                          >
                            {insIdeList.map(item => (
                              <Option key={item.ideId} value={item.ideId}>
                                {item.ideName}
                              </Option>
                            ))}
                          </Select>
                        )}
                      </FormItem>
                    </Col>
                  )}
                  {isSecAccu && !isInsSupplyRun ? (
                    <Col {...colProps}>
                      <FormItem
                        label={
                          <span>
                            工伤二级户
                            <span style={{ fontSize: 12, color: '#ccc' }}>
                              (大库需要选择工伤二级户)
                            </span>
                          </span>
                        }
                      >
                        {getFieldDecorator('requestInsAndAccuDto.injSecAccoId', {
                          rules: [{ required: true, message: '请选择' }],
                        })(
                          <Cascader
                            placeholder="请输入关键字检索"
                            options={secAccuList}
                            showSearch
                            notFoundContent="暂无工伤二级户"
                            onChange={(value, options) => this.selectSecAcco(value, options)}
                            changeOnSelect
                          />
                        )}
                      </FormItem>
                    </Col>
                  ) : null}
                </Fragment>
              )}
              {!isSerConfig && isHasIns && isHasAccu && (
                <Divider dashed style={{ margin: '0 32px' }} />
              )}
              {isHasAccu && (
                <Col {...colProps}>
                  <FormItem label="公积金申报工资">
                    {getFieldDecorator('requestInsAndAccuDto.accuDecWage', {
                      rules: [
                        {
                          required: true,
                          // message: '请输入小数点不超过2位的数字',
                          // pattern: /^-?\d+\.?\d{0,2}$/,
                          message: '请输入整数',
                          pattern: /^[1-9]\d*$/,
                        },
                      ],
                    })(
                      // <InputNumber
                      //   min={0}
                      //   max={9999999.99}
                      //   placeholder="请输入"
                      //   style={{ width: '100%' }}
                      // />
                      <InputNumber
                        min={0}
                        max={9999999}
                        placeholder="请输入"
                        style={{ width: '100%' }}
                      />
                    )}
                  </FormItem>
                </Col>
              )}

              {!isSerConfig && isHasAccu && (
                <Fragment>
                  <Col {...colProps}>
                    <FormItem label="公积金缴费方式">
                      {getFieldDecorator('requestInsAndAccuDto.accuPayFlag', {
                        rules: [{ required: true, message: '请选择' }],
                      })(
                        <Select
                          placeholder="请选择"
                          showSearch
                          optionFilterProp="children"
                          onChange={this.selectAccuPayWay}
                        >
                          {accuPayStyleList.map(item => (
                            <Option key={item.itemCode}>{item.itemName}</Option>
                          ))}
                        </Select>
                      )}
                    </FormItem>
                  </Col>
                  {!isAccuSupplyRun && (
                    <Col {...colProps}>
                      <FormItem label="公积金账户">
                        {getFieldDecorator('requestInsAndAccuDto.accuAcco', {
                          rules: [{ required: isAccuPayStyleSingle, message: '请选择' }],
                        })(
                          <Select
                            placeholder="请选择"
                            allowClear={!isAccuPayStyleSingle}
                            showSearch
                            optionFilterProp="children"
                            onChange={this.selectAccuAccount}
                          >
                            {accuAcountList.map(item => (
                              <Option key={item.accoId} value={item.accoId} fsOptions={item}>
                                {item.accoName}
                              </Option>
                            ))}
                          </Select>
                        )}
                      </FormItem>
                    </Col>
                  )}
                  <Col {...colProps}>
                    <FormItem label="公积金组合">
                      {getFieldDecorator('requestInsAndAccuDto.accuGrpId', {
                        rules: [{ required: true, message: '请选择' }],
                      })(
                        <Select
                          placeholder="请选择"
                          showSearch
                          optionFilterProp="children"
                          disabled={isAccuPayStyleSingle}
                        >
                          {accuGroupList.map(item => (
                            <Option key={item.lsPkgId} value={item.lsPkgId}>
                              {item.lsPkgName}
                            </Option>
                          ))}
                        </Select>
                      )}
                    </FormItem>
                  </Col>
                </Fragment>
              )}
              {isSerConfig && (
                <Col {...colProps}>
                  <FormItem label="服务配置">
                    {getFieldDecorator('requestInsAndAccuDto.serSetId', {
                      rules: [{ required: true, message: '请选择' }],
                    })(
                      <Select
                        placeholder="请选择"
                        showSearch
                        optionFilterProp="children"
                        onSelect={(value, options) => this.selectSerConfig(value, options)}
                      >
                        {serConfigList.map(item => (
                          <Option key={item.custConfId} serconinfo={item.confDetList}>
                            {item.custConfNo}
                          </Option>
                        ))}
                      </Select>
                    )}
                  </FormItem>
                </Col>
              )}
            </Row>
            {isSerConfig && (
              <Table
                columns={serConfigColumns}
                dataSource={serConfigData}
                rowKey="ass"
                bordered
                size="middle"
                pagination={false}
              />
            )}
          </Card>
        ) : null}
      </div>
    );
  }
}

export default InsAccuInfo;
